﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MODEL;
namespace Management_System.Controllers
{
    public class SellController : Controller
    {
        //销售
        // GET: /Sell/

        /// <summary>
        /// 销售订单
        /// </summary>
        /// <returns></returns>
        public ActionResult SellOrder()
        {
            return View();
        }
        /// <summary>
        /// 订单明细
        /// </summary>
        /// <returns></returns>
        public ActionResult OrderDetails()
        {
            //定义一个缓存依赖
            var r = HttpContext.Cache["Area"] as List<OrderForm>;
            if(r==null)
            {
                r = new BLL.Orderbll().list();
                //通过insert方法把数据一条一条添加到配置的缓存依赖中 insert（'缓存的名称'，数据，创建缓存依据（'数据名称','表的名称'））
                HttpContext.Cache.Insert("Area", r, new System.Web.Caching.SqlCacheDependency("Doruidotsystem", "orderform"));
                return View(r);
            }
            

            return View(r);
        }
        /// <summary>
        /// 销售发货
        /// </summary>
        /// <returns></returns>
        public ActionResult SalesDelivery()
        {
            return View();
        }
    }
}
